<template>
    <div class="app-container">
        <el-header>常规设置</el-header>
        <el-main>
            <el-form ref="form" :model="user" label-width="180px" size="medium">
                <span v-if="false">{{ user.id }}</span>
                <el-form-item label="名称">
                    <!--<el-input v-model="user.name" readonly="true"/>-->
                    <span>{{ user.name }}</span>
                </el-form-item>
                <el-form-item label="年龄">
                    <!--<el-input v-model="user.age"/>-->
                    <span>{{ user.age }} 岁</span>
                </el-form-item>
                <el-form-item label="性别">
                    <!--<el-radio-group v-model="user.gender" size="medium">-->
                    <!--<el-radio border label="男"/>-->
                    <!--<el-radio border label="女"/>-->
                    <!--</el-radio-group>-->
                    <span v-if="user.gender == 0">男</span>
                    <span v-else-if="user.gender == 1">女</span>
                    <span v-else>保密</span>
                </el-form-item>
                <el-form-item label="电子邮件">
                    <!--<el-input v-model="user.email"/>-->
                    <span>{{ user.email }}</span>
                </el-form-item>
                <el-form-item label="角色">
                    <!--<el-input v-model="user.email"/>-->
                    <span>{{ user.roles }}</span>
                </el-form-item>
                <el-form-item label="联系电话">
                    <!--<el-input v-model="user.email"/>-->
                    <span>{{ user.telephone }}</span>
                </el-form-item>
            </el-form>
        </el-main>
    </div>
</template>

<script>
    import { getInfo } from '@/api/login'
    export default {
        data() {
            return {
                user: {
                    id: '',
                    name: '',
                    gender: '',
                    age: '',
                    email: '',
                    telephone: '',
                    roles: ''
                }
            }
        },
        created() {
            this.fetchData()
        },
        methods: {
            fetchData() {
                console.log('查询用户信息')
                this.listLoading = true
                getInfo().then(res => {
                    this.user = res.data
                    this.listLoading = false
                })
            }
        }
    }
</script>

<style scoped>

</style>
